from flask_restful import fields


def build_response_type(dataType: dict = None) -> dict:
    response_data = {
        'code': fields.Integer(default=200),
        'msg': fields.String(default='ok'),
        'data': fields.Raw,
        'timestamp': fields.Integer
    }
    if dataType:
        response_data['data'] = fields.Nested(dataType)
    return response_data
